package com.wbs.shop.nuby.utils.push;

import android.content.Context;
import android.util.Log;

import com.wbs.shop.nuby.commom.Key;

import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;


/**
 * Created by zhoucl on 2017/8/28 0028.
 */

public class JPushUtils {
    private static Context context;
    private static int sequence = 1;

    public static void init(Context context) {
        JPushUtils.context = context;
    }

    public static void setUserTag(List<String> userTags) {
        if (userTags != null && !userTags.isEmpty()) {
            sequence++;
            TagAliasOperatorHelper.TagAliasBean tagAliasBean = new TagAliasOperatorHelper.TagAliasBean();
            tagAliasBean.action = TagAliasOperatorHelper.ACTION_ADD;
            tagAliasBean.tags = new HashSet<>(userTags);
            Log.e("JPushUtils", "开始设置");
            Log.e("JPushUtils", "tags===>" + tagAliasBean.tags.toString());
            TagAliasOperatorHelper.getInstance().handleAction(context, sequence, tagAliasBean);
        }
    }
}
